package cn.jobstart.common;

/**
*    @author sunke
*    @Date 2023-12-07 11:19:35
*    @description 附加数据填充
*/

import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;

public class FullConfigKeyConst {

    /**
    *  填充人才订阅任务列表
    */
    public final static String TALENT_SUBSCRIPTION_TASK_FULL_LIST_KEY = "TALENT_SUBSCRIPTION_TASK_FULL_LIST";
    /**
    *  填充操作日志记录详情
    */
    public final static String SYS_OPER_LOG_FULL_DETAIL_KEY = "SYS_OPER_LOG_FULL_DETAIL";
    /**
    *  填充人才账号列表
    */
    public final static String PERSON_FULL_LIST_KEY = "PERSON_FULL_LIST";
    /**
    *  填充系统用户详情
    */
    public final static String ADMIN_FULL_DETAIL_KEY = "ADMIN_FULL_DETAIL";
    /**
    *  填充员工权限组列表
    */
    public final static String ADMIN_PERMISSION_GROUP_FULL_LIST_KEY = "ADMIN_PERMISSION_GROUP_FULL_LIST";
    /**
    *  填充企业职位列表
    */
    public final static String COMPANY_JOB_FULL_LIST_KEY = "COMPANY_JOB_FULL_LIST";
    /**
    *  填充权限组列表
    */
    public final static String PERMISSION_GROUP_FULL_LIST_KEY = "PERMISSION_GROUP_FULL_LIST";
    /**
    *  填充人才备注列表
    */
    public final static String PERSON_REMARK_FULL_LIST_KEY = "PERSON_REMARK_FULL_LIST";
    /**
    *  填充企业联系人列表
    */
    public final static String COMPANY_CONTACT_FULL_LIST_KEY = "COMPANY_CONTACT_FULL_LIST";
    /**
    *  填充简历基础表详情
    */
    public final static String RESUME_BASIC_FULL_DETAIL_KEY = "RESUME_BASIC_FULL_DETAIL";
    /**
    *  填充人才画像列表
    */
    public final static String TALENT_PORTRAIT_FULL_LIST_KEY = "TALENT_PORTRAIT_FULL_LIST";
    /**
    *  填充企业详情
    */
    public final static String COMPANY_FULL_DETAIL_KEY = "COMPANY_FULL_DETAIL";
    /**
    *  填充操作日志记录列表
    */
    public final static String SYS_OPER_LOG_FULL_LIST_KEY = "SYS_OPER_LOG_FULL_LIST";
    /**
    *  填充爬虫监控详情
    */
    public final static String SPIDER_MONITOR_FULL_DETAIL_KEY = "SPIDER_MONITOR_FULL_DETAIL";
    /**
    *  填充人才备注详情
    */
    public final static String PERSON_REMARK_FULL_DETAIL_KEY = "PERSON_REMARK_FULL_DETAIL";
    /**
    *  填充简历能力标签详情
    */
    public final static String RESUME_CAPABILITY_LABEL_FULL_DETAIL_KEY = "RESUME_CAPABILITY_LABEL_FULL_DETAIL";
    /**
    *  填充权限表详情
    */
    public final static String RIGHTS_FULL_DETAIL_KEY = "RIGHTS_FULL_DETAIL";
    /**
    *  填充人才账号详情
    */
    public final static String PERSON_FULL_DETAIL_KEY = "PERSON_FULL_DETAIL";
    /**
    *  填充学校列表
    */
    public final static String SCHOOL_FULL_LIST_KEY = "SCHOOL_FULL_LIST";
    /**
    *  填充员工权限组详情
    */
    public final static String ADMIN_PERMISSION_GROUP_FULL_DETAIL_KEY = "ADMIN_PERMISSION_GROUP_FULL_DETAIL";
    /**
    *  填充简历基础表列表
    */
    public final static String RESUME_BASIC_FULL_LIST_KEY = "RESUME_BASIC_FULL_LIST";
    /**
    *  填充教育经历详情
    */
    public final static String RESUME_EDUCATIONAL_EXPERIENCE_FULL_DETAIL_KEY = "RESUME_EDUCATIONAL_EXPERIENCE_FULL_DETAIL";
    /**
    *  填充职位画像详情
    */
    public final static String ADMIN_JOB_PORTRAIT_FULL_DETAIL_KEY = "ADMIN_JOB_PORTRAIT_FULL_DETAIL";
    /**
    *  填充详情
    */
    public final static String SKILLED_PERSONNEL_FULL_DETAIL_KEY = "SKILLED_PERSONNEL_FULL_DETAIL";
    /**
    *  填充行业详情
    */
    public final static String INDUSTRY_FULL_DETAIL_KEY = "INDUSTRY_FULL_DETAIL";
    /**
    *  填充企业联系人详情
    */
    public final static String COMPANY_CONTACT_FULL_DETAIL_KEY = "COMPANY_CONTACT_FULL_DETAIL";
    /**
    *  填充列表
    */
    public final static String SKILLED_PERSONNEL_FULL_LIST_KEY = "SKILLED_PERSONNEL_FULL_LIST";
    /**
    *  填充简历附件详情
    */
    public final static String RESUME_BASIC_ATTACH_FULL_DETAIL_KEY = "RESUME_BASIC_ATTACH_FULL_DETAIL";
    /**
    *  填充爬虫监控列表
    */
    public final static String SPIDER_MONITOR_FULL_LIST_KEY = "SPIDER_MONITOR_FULL_LIST";
    /**
    *  填充企业职位详情
    */
    public final static String COMPANY_JOB_FULL_DETAIL_KEY = "COMPANY_JOB_FULL_DETAIL";
    /**
    *  填充权限组权限关联列表
    */
    public final static String GROUP_RIGHTS_FULL_LIST_KEY = "GROUP_RIGHTS_FULL_LIST";
    /**
    *  填充实习经历列表
    */
    public final static String RESUME_INTERSHIP_FULL_LIST_KEY = "RESUME_INTERSHIP_FULL_LIST";
    /**
    *  填充工作经历列表
    */
    public final static String RESUME_WORK_EXPERIENCE_FULL_LIST_KEY = "RESUME_WORK_EXPERIENCE_FULL_LIST";
    /**
    *  填充职位管理人员详情
    */
    public final static String ADMIN_JOB_MANAGER_FULL_DETAIL_KEY = "ADMIN_JOB_MANAGER_FULL_DETAIL";
    /**
    *  填充员工职位列表
    */
    public final static String ADMIN_JOB_FULL_LIST_KEY = "ADMIN_JOB_FULL_LIST";
    /**
    *  填充系统用户列表
    */
    public final static String ADMIN_FULL_LIST_KEY = "ADMIN_FULL_LIST";
    /**
    *  填充企业列表
    */
    public final static String COMPANY_FULL_LIST_KEY = "COMPANY_FULL_LIST";
    /**
    *  填充职位候选人列表
    */
    public final static String ADMIN_JOB_CANDIDATE_FULL_LIST_KEY = "ADMIN_JOB_CANDIDATE_FULL_LIST";
    /**
    *  填充项目经历详情
    */
    public final static String RESUME_PROJECT_EXPERIENCE_FULL_DETAIL_KEY = "RESUME_PROJECT_EXPERIENCE_FULL_DETAIL";
    /**
    *  填充员工职位备注列表
    */
    public final static String ADMIN_JOB_REMARK_FULL_LIST_KEY = "ADMIN_JOB_REMARK_FULL_LIST";
    /**
    *  填充项目经历列表
    */
    public final static String RESUME_PROJECT_EXPERIENCE_FULL_LIST_KEY = "RESUME_PROJECT_EXPERIENCE_FULL_LIST";
    /**
    *  填充专业技能详情
    */
    public final static String RESUME_PROFESSIONAL_SKILLS_FULL_DETAIL_KEY = "RESUME_PROFESSIONAL_SKILLS_FULL_DETAIL";
    /**
    *  填充行业列表
    */
    public final static String INDUSTRY_FULL_LIST_KEY = "INDUSTRY_FULL_LIST";
    /**
    *  填充权限组权限关联详情
    */
    public final static String GROUP_RIGHTS_FULL_DETAIL_KEY = "GROUP_RIGHTS_FULL_DETAIL";
    /**
    *  填充职位名称详情
    */
    public final static String JOB_FULL_DETAIL_KEY = "JOB_FULL_DETAIL";
    /**
    *  填充职位管理人员列表
    */
    public final static String ADMIN_JOB_MANAGER_FULL_LIST_KEY = "ADMIN_JOB_MANAGER_FULL_LIST";
    /**
    *  填充培训经历详情
    */
    public final static String RESUME_TRAINING_EXPERIENCE_FULL_DETAIL_KEY = "RESUME_TRAINING_EXPERIENCE_FULL_DETAIL";
    /**
    *  填充简历能力标签列表
    */
    public final static String RESUME_CAPABILITY_LABEL_FULL_LIST_KEY = "RESUME_CAPABILITY_LABEL_FULL_LIST";
    /**
    *  填充教育经历列表
    */
    public final static String RESUME_EDUCATIONAL_EXPERIENCE_FULL_LIST_KEY = "RESUME_EDUCATIONAL_EXPERIENCE_FULL_LIST";
    /**
    *  填充员工职位备注详情
    */
    public final static String ADMIN_JOB_REMARK_FULL_DETAIL_KEY = "ADMIN_JOB_REMARK_FULL_DETAIL";
    /**
    *  填充职位画像列表
    */
    public final static String ADMIN_JOB_PORTRAIT_FULL_LIST_KEY = "ADMIN_JOB_PORTRAIT_FULL_LIST";
    /**
    *  填充在校经历详情
    */
    public final static String RESUME_ASSOCIATION_ACTIVITY_FULL_DETAIL_KEY = "RESUME_ASSOCIATION_ACTIVITY_FULL_DETAIL";
    /**
    *  填充人才画像详情
    */
    public final static String TALENT_PORTRAIT_FULL_DETAIL_KEY = "TALENT_PORTRAIT_FULL_DETAIL";
    /**
    *  填充在校经历列表
    */
    public final static String RESUME_ASSOCIATION_ACTIVITY_FULL_LIST_KEY = "RESUME_ASSOCIATION_ACTIVITY_FULL_LIST";
    /**
    *  填充证书详情
    */
    public final static String RESUME_CERTIFICATE_FULL_DETAIL_KEY = "RESUME_CERTIFICATE_FULL_DETAIL";
    /**
    *  填充证书列表
    */
    public final static String RESUME_CERTIFICATE_FULL_LIST_KEY = "RESUME_CERTIFICATE_FULL_LIST";
    /**
    *  填充求职意向列表
    */
    public final static String RESUME_EMPLOYMENT_INTENTION_FULL_LIST_KEY = "RESUME_EMPLOYMENT_INTENTION_FULL_LIST";
    /**
    *  填充求职意向详情
    */
    public final static String RESUME_EMPLOYMENT_INTENTION_FULL_DETAIL_KEY = "RESUME_EMPLOYMENT_INTENTION_FULL_DETAIL";
    /**
    *  填充实习经历详情
    */
    public final static String RESUME_INTERSHIP_FULL_DETAIL_KEY = "RESUME_INTERSHIP_FULL_DETAIL";
    /**
    *  填充权限表列表
    */
    public final static String RIGHTS_FULL_LIST_KEY = "RIGHTS_FULL_LIST";
    /**
    *  填充简历附件列表
    */
    public final static String RESUME_BASIC_ATTACH_FULL_LIST_KEY = "RESUME_BASIC_ATTACH_FULL_LIST";
    /**
    *  填充人才订阅任务详情
    */
    public final static String TALENT_SUBSCRIPTION_TASK_FULL_DETAIL_KEY = "TALENT_SUBSCRIPTION_TASK_FULL_DETAIL";
    /**
    *  填充职位名称列表
    */
    public final static String JOB_FULL_LIST_KEY = "JOB_FULL_LIST";
    /**
    *  填充员工职位详情
    */
    public final static String ADMIN_JOB_FULL_DETAIL_KEY = "ADMIN_JOB_FULL_DETAIL";
    /**
    *  填充权限组详情
    */
    public final static String PERMISSION_GROUP_FULL_DETAIL_KEY = "PERMISSION_GROUP_FULL_DETAIL";
    /**
    *  填充专业技能列表
    */
    public final static String RESUME_PROFESSIONAL_SKILLS_FULL_LIST_KEY = "RESUME_PROFESSIONAL_SKILLS_FULL_LIST";
    /**
    *  填充学校详情
    */
    public final static String SCHOOL_FULL_DETAIL_KEY = "SCHOOL_FULL_DETAIL";
    /**
    *  填充工作经历详情
    */
    public final static String RESUME_WORK_EXPERIENCE_FULL_DETAIL_KEY = "RESUME_WORK_EXPERIENCE_FULL_DETAIL";
    /**
    *  填充职位候选人详情
    */
    public final static String ADMIN_JOB_CANDIDATE_FULL_DETAIL_KEY = "ADMIN_JOB_CANDIDATE_FULL_DETAIL";
    /**
    *  填充培训经历列表
    */
    public final static String RESUME_TRAINING_EXPERIENCE_FULL_LIST_KEY = "RESUME_TRAINING_EXPERIENCE_FULL_LIST";

    public final static String FULL_ALL_KEY = "FULL_ALL";
    public static Set<String> ALL_CONFIG = new HashSet<>();

    static {
        ALL_CONFIG.add(TALENT_SUBSCRIPTION_TASK_FULL_LIST_KEY);
        ALL_CONFIG.add(SYS_OPER_LOG_FULL_DETAIL_KEY);
        ALL_CONFIG.add(PERSON_FULL_LIST_KEY);
        ALL_CONFIG.add(ADMIN_FULL_DETAIL_KEY);
        ALL_CONFIG.add(ADMIN_PERMISSION_GROUP_FULL_LIST_KEY);
        ALL_CONFIG.add(COMPANY_JOB_FULL_LIST_KEY);
        ALL_CONFIG.add(PERMISSION_GROUP_FULL_LIST_KEY);
        ALL_CONFIG.add(PERSON_REMARK_FULL_LIST_KEY);
        ALL_CONFIG.add(COMPANY_CONTACT_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_BASIC_FULL_DETAIL_KEY);
        ALL_CONFIG.add(TALENT_PORTRAIT_FULL_LIST_KEY);
        ALL_CONFIG.add(COMPANY_FULL_DETAIL_KEY);
        ALL_CONFIG.add(SYS_OPER_LOG_FULL_LIST_KEY);
        ALL_CONFIG.add(SPIDER_MONITOR_FULL_DETAIL_KEY);
        ALL_CONFIG.add(PERSON_REMARK_FULL_DETAIL_KEY);
        ALL_CONFIG.add(RESUME_CAPABILITY_LABEL_FULL_DETAIL_KEY);
        ALL_CONFIG.add(RIGHTS_FULL_DETAIL_KEY);
        ALL_CONFIG.add(PERSON_FULL_DETAIL_KEY);
        ALL_CONFIG.add(SCHOOL_FULL_LIST_KEY);
        ALL_CONFIG.add(ADMIN_PERMISSION_GROUP_FULL_DETAIL_KEY);
        ALL_CONFIG.add(RESUME_BASIC_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_EDUCATIONAL_EXPERIENCE_FULL_DETAIL_KEY);
        ALL_CONFIG.add(ADMIN_JOB_PORTRAIT_FULL_DETAIL_KEY);
        ALL_CONFIG.add(SKILLED_PERSONNEL_FULL_DETAIL_KEY);
        ALL_CONFIG.add(INDUSTRY_FULL_DETAIL_KEY);
        ALL_CONFIG.add(COMPANY_CONTACT_FULL_DETAIL_KEY);
        ALL_CONFIG.add(SKILLED_PERSONNEL_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_BASIC_ATTACH_FULL_DETAIL_KEY);
        ALL_CONFIG.add(SPIDER_MONITOR_FULL_LIST_KEY);
        ALL_CONFIG.add(COMPANY_JOB_FULL_DETAIL_KEY);
        ALL_CONFIG.add(GROUP_RIGHTS_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_INTERSHIP_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_WORK_EXPERIENCE_FULL_LIST_KEY);
        ALL_CONFIG.add(ADMIN_JOB_MANAGER_FULL_DETAIL_KEY);
        ALL_CONFIG.add(ADMIN_JOB_FULL_LIST_KEY);
        ALL_CONFIG.add(ADMIN_FULL_LIST_KEY);
        ALL_CONFIG.add(COMPANY_FULL_LIST_KEY);
        ALL_CONFIG.add(ADMIN_JOB_CANDIDATE_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_PROJECT_EXPERIENCE_FULL_DETAIL_KEY);
        ALL_CONFIG.add(ADMIN_JOB_REMARK_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_PROJECT_EXPERIENCE_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_PROFESSIONAL_SKILLS_FULL_DETAIL_KEY);
        ALL_CONFIG.add(INDUSTRY_FULL_LIST_KEY);
        ALL_CONFIG.add(GROUP_RIGHTS_FULL_DETAIL_KEY);
        ALL_CONFIG.add(JOB_FULL_DETAIL_KEY);
        ALL_CONFIG.add(ADMIN_JOB_MANAGER_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_TRAINING_EXPERIENCE_FULL_DETAIL_KEY);
        ALL_CONFIG.add(RESUME_CAPABILITY_LABEL_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_EDUCATIONAL_EXPERIENCE_FULL_LIST_KEY);
        ALL_CONFIG.add(ADMIN_JOB_REMARK_FULL_DETAIL_KEY);
        ALL_CONFIG.add(ADMIN_JOB_PORTRAIT_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_ASSOCIATION_ACTIVITY_FULL_DETAIL_KEY);
        ALL_CONFIG.add(TALENT_PORTRAIT_FULL_DETAIL_KEY);
        ALL_CONFIG.add(RESUME_ASSOCIATION_ACTIVITY_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_CERTIFICATE_FULL_DETAIL_KEY);
        ALL_CONFIG.add(RESUME_CERTIFICATE_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_EMPLOYMENT_INTENTION_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_EMPLOYMENT_INTENTION_FULL_DETAIL_KEY);
        ALL_CONFIG.add(RESUME_INTERSHIP_FULL_DETAIL_KEY);
        ALL_CONFIG.add(RIGHTS_FULL_LIST_KEY);
        ALL_CONFIG.add(RESUME_BASIC_ATTACH_FULL_LIST_KEY);
        ALL_CONFIG.add(TALENT_SUBSCRIPTION_TASK_FULL_DETAIL_KEY);
        ALL_CONFIG.add(JOB_FULL_LIST_KEY);
        ALL_CONFIG.add(ADMIN_JOB_FULL_DETAIL_KEY);
        ALL_CONFIG.add(PERMISSION_GROUP_FULL_DETAIL_KEY);
        ALL_CONFIG.add(RESUME_PROFESSIONAL_SKILLS_FULL_LIST_KEY);
        ALL_CONFIG.add(SCHOOL_FULL_DETAIL_KEY);
        ALL_CONFIG.add(RESUME_WORK_EXPERIENCE_FULL_DETAIL_KEY);
        ALL_CONFIG.add(ADMIN_JOB_CANDIDATE_FULL_DETAIL_KEY);
        ALL_CONFIG.add(RESUME_TRAINING_EXPERIENCE_FULL_LIST_KEY);
    }

    /**
     * 判断是否要加载对应的key 的数据
     *
     * @param fullConfigSet
     * @param key
     * @return
     */
    public static boolean hasFullData(Set<String> fullConfigSet, String key) {
        return fullConfigSet == null || fullConfigSet.contains(FULL_ALL_KEY) ||
                fullConfigSet.contains(key);
    }

    /**
     * 排除后返回剩下的
     *
     * @param unFullConfigSet
     * @return
     */
    public static Set<String> excludeFullData(Set<String> unFullConfigSet) {
        if (StringUtil.isNullOrEmpty(unFullConfigSet)) {
            return ALL_CONFIG;
        }
        return ALL_CONFIG.stream().filter(item -> unFullConfigSet.stream().noneMatch(one -> item.equalsIgnoreCase(one))).collect(Collectors.toSet());
    }

    /**
     * 从排除后的数据查询是否要加载
     * @param unFullConfigSet
     * @param key
     * @return
     */
    public static boolean hasFullDataFromUnFullData(Set<String> unFullConfigSet,String key) {
        return hasFullData(excludeFullData(unFullConfigSet),key);
    }
}
